<template>
  <div id="topList">
    <p class="tit">{{ title + "榜" }}</p>
    <van-tab :title="title" class="topList">
      <template>
        <div v-for="item in topList" :key="item.id">
          <div>
            <van-image width="100" height="100" :src="item.coverImgUrl" />
          </div>
        </div>
      </template>
    </van-tab>
  </div>
</template>

<script>
export default {
  name: 'TopList',
  props: {
    topList: {
      type: [Object, Array],
      required: true
    },
    title: {
      type: String,
      required: true
    }
  },
  data () {
    return {}
  },

  // 定义方法
  methods: {}
}
</script>

<style scoped lang="less">
#topList {
  padding: 10px 0 10px 18px;
  margin-top: 15px;
  background-color: #fff;
  border-radius: 15px;
  .tit {
    text-align: left;
    font-size: 18px;
  }
  .topList {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: stretch;
    align-items: center;
    .van-image {
      width: 100px;
      height: 100px;
      margin-top: 10px;
      margin-right: 18px;
    }
  }
}
</style>
